package ch.usi.inf.pf2.cell;


import ch.usi.inf.pf2.Cell;
/**
 * A CellTest it tests if Cell class works or not.
 * 
 * @author elham.menzer@gmail.com
 */


import junit.framework.TestCase;

public class CellTest extends TestCase {
	
	
	
	//I wanted to test the parseString ,I did it like this
	//because it did not let me to do this for that because 
	//it was private ,and with the test I show that if you 
	//give it String that contains a single number to it ,
	//it reads it correctly and represent it as a node.
	

	public void testNumberCell()
	{
		double number = 1.2345;
		Cell cell = new Cell(Double.toString(number));
		assertEquals(number,(cell.getNode()).evaluate());
		
		
	}

	public void testGetStr(){
		String str = "test" ;
		Cell cell = new Cell(str);
		cell.getStr();
		assertEquals(str,cell.getStr());
		
	}

	public void testSetStr(){
		String str = "test" ;
		Cell cell = new Cell(str);
		cell.setStr(str);
		assertEquals("test",cell.getStr());
		
	}
	
	public void testtextlength()
	{
		Cell cell=new Cell("HiEveryBodyIamMonaEsmaeili");
		assertEquals(26, cell.textlength());
	}
	
	public void testspilit()
	{
		String str="HiEveryBodyIamMonaEsmaeili";
		Cell cell=new Cell(str);
		cell.cut();
	}


}
